import components, { RenderForm, DetailForm, ImageViewer } from '@/components'
import useMessage from '@/composables/message'
import axios from '@/http'

/**
 * 注册表单生成器
 * @author 一如既往 <h_gxi@foxmail.com>
 * @param {App<Element>} app Vue3实例
 * @param {Axios} request axios实例
 */
const install = (app, request = axios, message = useMessage) => {
  app.use(components)
  app.config.globalProperties.$message = message()
  app.config.globalProperties.$axios = request
}

export default {
  install
}

export { RenderForm, DetailForm, ImageViewer }
